package com.weiyi.biz.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.weiyi.biz.mapper.WeiyiLogMapper;
import com.weiyi.biz.domain.WeiyiLog;
import com.weiyi.biz.service.IWeiyiLogService;
import com.weiyi.common.core.text.Convert;

/**
 * 位移日志Service业务层处理
 *
 * @author gq
 * @date 2020-08-31
 */
@Service
public class WeiyiLogServiceImpl implements IWeiyiLogService
{
    @Autowired
    private WeiyiLogMapper weiyiLogMapper;

    /**
     * 查询位移日志
     *
     * @param ID 位移日志ID
     * @return 位移日志
     */
    @Override
    public WeiyiLog selectWeiyiLogById(Long ID)
    {
        return weiyiLogMapper.selectWeiyiLogById(ID);
    }

    /**
     * 查询位移日志列表
     *
     * @param weiyiLog 位移日志
     * @return 位移日志
     */
    @Override
    public List<WeiyiLog> selectWeiyiLogList(WeiyiLog weiyiLog)
    {
        return weiyiLogMapper.selectWeiyiLogList(weiyiLog);
    }

    /**
     * 新增位移日志
     *
     * @param weiyiLog 位移日志
     * @return 结果
     */
    @Override
    public int insertWeiyiLog(WeiyiLog weiyiLog)
    {
        return weiyiLogMapper.insertWeiyiLog(weiyiLog);
    }

    /**
     * 修改位移日志
     *
     * @param weiyiLog 位移日志
     * @return 结果
     */
    @Override
    public int updateWeiyiLog(WeiyiLog weiyiLog)
    {
        weiyiLog.setOperateTime(new Date());
        return weiyiLogMapper.updateWeiyiLog(weiyiLog);
    }

    /**
     * 删除位移日志对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWeiyiLogByIds(String ids)
    {
        return weiyiLogMapper.deleteWeiyiLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除位移日志信息
     *
     * @param ID 位移日志ID
     * @return 结果
     */
    @Override
    public int deleteWeiyiLogById(Long ID)
    {
        return weiyiLogMapper.deleteWeiyiLogById(ID);
    }
}
